import { defineStore } from 'pinia';


export const SystemStore = defineStore('system', {
    state: () => ({
        isWsConnected: false, // ws是否连接
        isLoggedIn: false, // 是否已登录
    }),
    actions: {
        setWsConnected(v: boolean) {
            this.isWsConnected = v;
        },
        setLoggedIn(v: boolean) {
            this.isLoggedIn = v;
        },
    },
    getters: {
        isServerLoggedIn(state) { // 是否已经同步服务器登录状态
            return state.isLoggedIn
        }
    }
});
